home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1989 / Apr 89 / T0035-Rekindling Lock⁄Unl-Apr89 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.2 KB  |  30 lines  |  [TEXT/GEOL]

  1. Item    5839226                         24-April-89        10:56
  2.  
  3. From:   PASCOE1                         Pascoe, Geoff
  4.  
  5. To:     MACAPP.TECH$                    MACAPP Tech
  6.  
  7. Sub:    Rekindling Lock/Unlock, etc.
  8.  
  9. I've use both techniques of of keeping a lock count and reference count on
  10. objects.
  11.  
  12. The lock count-
  13.     I agree that if lock/unlock is implemented, it should entail a lock count.
  14. However, I'm ambivalent as to whether this belongs in the MacApp release.  I
  15. use Lock/Unlock to lock a handle (not the object itself) that is one of the
  16. instance variables of the lock.  Implementing without a lock count is
  17. potentially dangerous, implementing it with a lock count adds overhead to EVERY
  18. object.  I'd just as soon leave it as a recipe.
  19.  
  20. The reference count-
  21.     I've used this technique also.  It can be useful, if used sparingly in a
  22. design where acquiring and releasing objects occurs in only a few places and is
  23. tightly controlled.  In my work, I only use this on a particular class (and
  24. subclass) of objects and its only used in a few places.  Trying to use this as
  25. a substitute for REAL garbage collection is a BAD idea and it doesn't belong in
  26. MacApp.  Again, I suggest a recipe.
  27.  
  28. Geoff
  29.  
  30.